package com.itheima.array;

import java.util.Arrays;
import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        int[] arr={22,55,88,11,99};
        System.out.println("安排前:"+Arrays.toString(arr));
        Arrays.sort(arr);
        System.out.println("安排后:"+Arrays.toString(arr));
        System.out.println("请输入要查找的元素");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
        int i = Arrays.binarySearch(arr, number);
        System.out.println(i);


    }

}
